import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './registerServiceWorker'
import moment from 'moment'
import './style/style.less'

import axios from 'axios'
import qs from 'qs'
import echarts from 'echarts'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'

axios.interceptors.request.use(config => {
  // console.log(config)
  config.headers.Authorization = window.sessionStorage.getItem('token')
  // 在最后必须return config
  return config
})

Vue.prototype.qs = qs
Vue.prototype.axios = axios
Vue.prototype.$echarts = echarts
Vue.prototype.$moment = moment

Vue.use(ElementUI)
Vue.config.productionTip = false

moment.locale('zh-cn')

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
